package com.kakarote.examine.constant;

import com.kakarote.core.common.enums.SystemCodeEnum;
import com.kakarote.core.exception.CrmException;

import java.util.Objects;

public enum ExamineLogHandlerType {
    //1转交
    FORWARD(1),
    //委托
    DELEGATE(3),
    ;

    private ExamineLogHandlerType(Integer type) {
        this.type = type;
    }

    private Integer type;

    public Integer getType() {
        return type;
    }

    public static ExamineLogHandlerType valueOf(Integer type) {
        for (ExamineLogHandlerType examineLogHandlerType : values()) {
            if (Objects.equals(type, examineLogHandlerType.getType())) {
                return examineLogHandlerType;
            }
        }
        throw new CrmException(SystemCodeEnum.SYSTEM_NO_VALID);
    }
}
